package cn.changgou.dao;

import cn.changgou.goods.pojo.Brand;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/*
* 品牌dao
* 使用通用Mapper，dao接口需要继承tk.mybatis.mapper.common.Mapper
* */
public interface BrandMapper extends Mapper<Brand> {

    /*根据分类ID查询品牌集合-分类ID*/
    @Select("SELECT tb.* FROM tb_brand tb, tb_category_brand tcb WHERE tb.id = tcb.brand_id AND tcb.category_id = #{categoryId}")
    List<Brand> findByCategory(Integer categoryId);
}
